<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>课工场论坛列表</title>
		<link href="css/bbs.css" rel="stylesheet">
		<script src="../../jquery-3.4.1.min.js"></script>
		<script>
			 $(function(){
			$("#sp1").click(function(){
				$("#f1").css("display","block");
			}); 
			$("#f2").click(function(){
				let tie=$("#postList").find("li").last();
				let biao=$("#title").val();
				let ban=$("#section").val();
				let shi=new Date().toLocaleString();
				let li1 = $(`<li><div><img src="images/tou04.jpg"></div><h1>${biao}</h1><p><span>版块:${ban}</span><span>发表时间:${shi}</span></p> </li>`);
				
				
				$(li1).prependTo("#postList")
				
				$("#f1").css("display","none");
			}); 	
			
			 });
		</script>
	</head>
	<body>
		<div class="bbs">
			<header><span id="sp1" >我要发帖</span></header>
			<section>
				<ul id="postList">
					<li>
						<div><img src="images/tou02.jpg"></div>
						<h1>ggggg</h1>
						<p><span>版块：新手报到</span><span>发表时间：2019-11-18 17:28</span></p>
					</li>
					<li>
						<div>
							<img src="images/tou01.jpg"></div>
						<h1>ddddd</h1>
						<p><span>版块：新课来了</span><span>发表时间：2019-11-18 17:27</span></p>
					</li>
				</ul>
			</section>

			<div class="post" id="f1" >
				<input class="title" id="title" placeholder="请输入标题（1-50个字符）">
				所属版块：<select id="section">
					<option>请选择版块</option>
					<option>电子书籍</option>
					<option>新课来了</option>
					<option>新手报到</option>
					<option>职业规划</option>
				</select>
				<textarea class="content"></textarea>
				<input class="btn" value="发布" id="f2" >
			</div>
		</div>
	</body>
</html>
